{{template "admin/public/head.html" .}}
<section>
	<aside>
		{{template "admin/public/nav.html" .}}
	</aside>
	<article>
		<div class="top-title">
			<dl>
				<dt><h1>{{.name}}</h1></dt>
			</dl>
		</div> 
		<div class="content">
			<div class="release">
				<dl>
					<dt><i class="iconfont">&#xe649;</i> <b>{{.title}}说明</b><br>
						下方是{{.title}}列表,可以进行添加,修改<br>
					</dt>
				</dl>
			</div>
			<form action="" method="get" autocomplete="on" class="form">
				<table class="table1">
					<thead><th width="10%"></th><th width="15%"></th><th width="10%"></th><th width="15%"></th><th width="10%"></th><th width="15%"></th><th width="10%"></th><th width="15%"></th></thead>
					<tr>
						<td class="genre">栏目</td>
						<td colspan="2">{{.name}}</td>
						<td class="genre">简介</td>
						<td colspan="4"><input type="text" name="introduce" class="input95" value="{{.info.introduce}}"></td>
					</tr>
					<tr class="cell">
						<td class="genre">缩略图</td>
						<td colspan="7">
							<div class="thumbnail">
								{{range $i,$v := .images}}
								<dl>
									<dt>
										<img src="{{if $v}}{{.pathname}}{{else}}/static/img/admin/uppic.png{{end}}" class="uppic">
										<input type="file" onchange="uppic(this, 'function')" accept="image/*">
										<input type="hidden" name="img" value="{{if $v}}{{.id}}{{end}}">
									</dt>
									<dd>图片 X<script>document.write({{$i}} + 1)</script></dd>
									<dd class="del_img">删除图片</dd>
								</dl>
								{{end}}
							</div>
						</td>
					</tr>
					<tr><td colspan="8"></td></tr>
					<input type="hidden" name="id" value="{{.info.id}}">
					<input type="hidden" name="sid" value="{{.sid}}">
			</form>
					<tr class="trbutton">
						<td colspan="2"><button type="button" class="button">保存</button></td>
						<td colspan="6">
							<p>
								<i class="iconfont">&#xe649;</i> 请检查内容确认发布的内容没有涉及传播谣言、政治话题或违反广告法夸大宣传产品等。
							</p>
							<div class="help">帮助
								<div class="help_qr"><img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/all/qr-code.jpg" alt=""></div>
							</div>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</article>
</section>

<footer><!-- 系统监控内容 --></footer>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/jquery.jedate.min.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/toast.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/uppic.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/xcConfirm.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/app.js"></script>
<script>
	$('.button').click(function () {
		if (!$('input[name="introduce"]').val()){
			window.wxc.xcConfirm("请输入简介！","info"); return false;
		}
		var form=$('form').serialize()
		$.ajax({
			url:window.location.href,
			data:form,
			type:'post',
			success:function(res){
				if(res.status == 1){
					 window.wxc.xcConfirm("保存成功","success",{onClose:function(){
                        window.location.href = document.referrer
                    }})
				}else {
					 window.wxc.xcConfirm("保存失败,请重试!","error")
				}
			}
		})
	})
	/*
	$('.button').click(function () {
		var ctn = $('.cell')
		data = []
		ctn.each(function () {
			var img = $(this).find('input[name=img]')
			var id = $(this).attr('data-id')
			var introduce = $(this).prev().find('input[name=introduce]').val()
			imgArr = []
			img.each(function () {
				var text = $(this).val()
				if (text == '') {
					return
				}
				imgArr.push(text)
			})
			data.push({
				id: id,
				images: imgArr.join(','),
				introduce: introduce
			})
		})
		reqData = {
			data: data,
			id: {{.id}}
		}
		$.ajax({
			url:window.location.href,
			data: JSON.stringify(reqData),
			type:'post',
			success:function(res){
				if(res.status == 1){
					 window.wxc.xcConfirm("保存成功","success",{onClose:function(){
                        window.location.href = document.referrer
                    }})
				}else {
					 window.wxc.xcConfirm("保存失败,请重试!","error")
				}
			}
		})
	})	
	*/
</script>
</body>
</html>
